﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace huaguwang.hgmanage.Power
{
    public partial class User_EPass : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        readonly D_T_AdminUser_Exp _Dal = new D_T_AdminUser_Exp();

        protected void Button1_Click(object sender, EventArgs e)
        {
            var u1 = TextBox3.Text.Trim();
            var u2 = TextBox1.Text.Trim();
            var user = this.Exp_GetUser();
            if (user == null)
            {
                Page.Exp_PageAlter("用户没有登录");
                return;
            }
            var intRef = _Dal.UpdatePass(user.id, u1, u2);
            if (intRef > 0)
            {
                Page.Exp_PageWriteLog(Log_Type.update, "用户密码", user.id);
                TextBox1.Text = "";
                TextBox2.Text = "";
                TextBox3.Text = "";
                Page.Exp_PageAlter("修改成功");
            }
            else
            {
                Page.Exp_PageAlter("修改失败");
            }
        }
    }
}
